<?PHP

	class tpl_appearance {
		
		public static function appearance(){
		
			$themes = '';
			$class = 'td2';
			foreach($GLOBALS['OUTPUT']->themes as $themename=>$theme_info){
				
				$link = base64_encode($themename);
				
				$hidden = ($theme_info['hide']) ? $GLOBALS['LANG']->lang_formcommon->yes : $GLOBALS['LANG']->lang_formcommon->no;
				
				if($GLOBALS['OUTPUT']->settings['default_theme'] == $themename){
					$links = "[{$GLOBALS['LANG']->lang_admin->default}]";
				}else{
					$links = <<<EOV
<a href='./index.php?act=admin&page=appearance{$GLOBALS['OUTPUT']->ses}&makedefault=<?PHP echo base64_encode($themename); ?>'>[{$GLOBALS['LANG']->lang_admin->makedefault}]</a>
<a href='./index.php?act=admin&page=appearance{$GLOBALS['OUTPUT']->ses}&delete=<?PHP echo base64_encode($themename); ?>'>[{$GLOBALS['LANG']->lang_admin->delete}]</a>
EOV;
				}
				
				if($theme_info['hide']){
					$links .= " <a href='./index.php?act=admin&page=appearance{$GLOBALS['OUTPUT']->ses}&unhide=$link'>[{$GLOBALS['LANG']->lang_admin->unhide}]</a>";
				}else{
					$links .= " <a href='./index.php?act=admin&page=appearance{$GLOBALS['OUTPUT']->ses}&hide=$link'>[{$GLOBALS['LANG']->lang_admin->hide}]</a>";
				}
				
				$themes .= <<<EOV
<tr>
	<td class='$class' width='50%'>{$theme_info['themename']}</td>
	<td class='$class' width='20%'>{$hidden}</td>
	<td class='$class' width='30%'>{$links}</td>
</tr>
EOV;
				$class = ($class == 'td2' ? 'td1' : 'td2');
			}
			
			return	tpl_globals::header() .
				<<<EOV
<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_admin->managethemes}</div>
<table style='width: 100%;' cellspacing='1' cellpadding='5'>
	<tr>
		<td class='table_header_row' width='50%'>{$GLOBALS['LANG']->lang_admin->themename}</td>
		<td class='table_header_row' width='20%'>{$GLOBALS['LANG']->lang_admin->ishidden}</td>
		<td class='table_header_row' width='30%'>{$GLOBALS['LANG']->lang_admin->action}</td>
	</tr>
	{$themes}
</table>
EOV
.
			tpl_globals::footer();
				
		}
		
	}

?>